﻿// ===============================================================================
//  Copyright © ymind.net. All rights reserved .
//  官方网站：http://ymind.net/
//  版权所有：彦铭工作室 老陈出品
// ===============================================================================

using System;
using Lcsoft.RssEngine.Shared;

namespace Lcsoft.RssEngine.RssItem
{
	/// <summary>A reference to an attachment to the item</summary>
	[Serializable]
	public class RssEnclosure : IRssElement
	{
		private int _length = RssDefault.IntValue;
		private string _type = String.Empty;
		private Uri _uri = RssDefault.UriValue;

		/// <summary>Where the enclosure is located</summary>
		public Uri Url
		{
			get { return this._uri; }
			set { this._uri = RssDefault.Check(value); }
		}

		/// <summary>The size of the enclosure, in bytes</summary>
		/// <remarks>-1 represents a null.</remarks>
		public int Length
		{
			get { return this._length; }
			set { this._length = RssDefault.Check(value); }
		}

		/// <summary>A standard Multipurpose Internet Mail Extensions (MIME) type</summary>
		public string Type
		{
			get { return this._type; }
			set { this._type = RssDefault.Check(value); }
		}
	}
}
